<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>网页换肤</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        div{
            width: 600px;
            margin: 0 auto;
            text-align: center;
        }
        span{
            width: 20px;
            height: 20px;
            display: inline-block;
        }
        .red{
            background-color: red;
        }
        .pink{
            background-color: pink;
        }
        .skyblue{
            background-color: skyblue;
        }
        ul li{
            list-style: none;
            float: left;
            width: 40px;
            height: 20px;
            border: 1px solid green;
            color: green;
            padding: 10px 20px;
            /* background-color: green; */
        }
    </style>
</head>
<body>
    <div>
        <span class="red" onclick="red()"></span>
        <span class="pink" onclick="pink()"></span>
        <span class="skyblue" onclick="skyblue()"></span>
        <ul>
            <li>新闻</li>
            <li>娱乐</li>
            <li>体育</li>
            <li>电影</li>
            <li>音乐</li>
            <li>旅游</li>
        </ul>
    </div>

    <script>
        function red(){
            document.body.style.backgroundColor = 'red'
        }
        function pink(){
            document.body.style.backgroundColor = 'pink'
        }
        function skyblue(){
            document.body.style.backgroundColor = 'skyblue'
        }
    </script>
</body>
</html>